<form action="" method="post">
    <div class="col-md-12">
        <div class="card">
            <div class="card-header">
                <h3 class="card-title">权限组权限列表</h3>
            </div>
            <div class="card-body">
                <input type="hidden" name="token_items" value="{:pass(time())}"/>
                <foreach name="group_list" item="v" key="k">
                    <div class="form-group">
                        <label>
                            <input type="checkbox" name="content[]" value="{$k}" class="all" <?php if (in_array($k, explode(',', $g_info['content']))) { echo 'checked'; } ?>>
<?php if ($v['parent']): ?>{$v.parent}-<?php endif; ?>{$v.title}
                        </label>
                    </div>
                </foreach>
            </div>
            <div class="card-footer">
                <label>
                    <input id="all" type="checkbox">全选
                </label>
                <button type="submit" class="btn btn-primary">提交</button>
            </div>
        </div>
    </div>
</form>
<script>
    $("#all").click(function () {
        var stat = this.checked;
        $("input[class=all]").each(function () {
            this.checked = stat;
        });
    });
</script>